//修改号码状态
var updateNumber = function () {
  var sqlParams = new Object();
  sqlParams.uuid = Params.uuid;
  sqlParams.id = Params.id;
  sqlParams.is_freeze = Params.is_freeze;
  sqlParams.is_convert = Params.is_convert;
  var sql1 = "select a.uuid,b.*,c.name,c.permission from app_open_api_c002_callout_user_verify_2 a left join app_open_api_c003_hbdh_user_1 b on a.user_id=b.id  left join app_open_api_c001_hbdh_role_1 c on b.role_id=c.id where a.uuid=#{uuid}";
  var result1 = JSON.parse(CustomizeUtil.abilitySql(sql1, sqlParams));
  if (result1.data.count > 0) {
    // 日志记录
    sqlParams.username = result1.data.results[0].username
    var sql_log = "insert into app_open_api_c001_zhyd_log_6(phone,create_time,method) values(#{username},now(),'updateNumber')";
    CustomizeUtil.abilitySql(sql_log, sqlParams);
    // 状态更改
    var sql = "update app_open_api_c003_hbdh_number_1 set is_freeze=#{is_freeze},is_convert=#{is_convert} where id=#{id}";
    JsResult.result = CustomizeUtil.abilitySql(sql, sqlParams);

  } else {
    var result2 = "{'data':{'count':1,'results':'登录失效','status':1},'publicData':{'retInfo':{'retType':1,'retCode':0,'retMsg':'登录失效，请先登录'}}}";
    JsResult.result = result2;
  }
}
updateNumber();
